package com.zxy.lm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zxy.lm.VO.AdminLoginVO;
import com.zxy.lm.entity.Admin;
import com.zxy.lm.mapper.AdminMapper;
import com.zxy.lm.service.AdminService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jiusi
 * @since 2021-06-22
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {

    @Override
    public Admin login(AdminLoginVO adminVO) {
        QueryWrapper<Admin> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", adminVO.getUsername());
        queryWrapper.eq("password", adminVO.getPassword());
        return baseMapper.selectOne(queryWrapper);
    }
}
